import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/MainLayout.vue'),
    redirect: '/order', // 默认重定向到子路由
    children: [
      {
        path: '/order',
        name: 'order',
        component: () => import('@/views/orderManagement/index.vue')
      },
      {
        path: '/cooperative',
        name: 'cooperative',
        component: () => import('@/views/cooperativeManagement/index.vue')
      },
      {
        path: '/examination',
        name: 'examination',
        component: () => import('@/views/examinationManagement/index.vue')
      },
      {
        path: '/system',
        name: 'system',
        component: () => import('@/views/systemManagement/index.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'LoginPage',
    component: ()=> import('@/views/login/index.vue')
  }

]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
